﻿
using System;
using System.ServiceModel;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using URS.EnterpriseServices.DalEf;

namespace URS.EnterpriseServices.Service
{
    /// <summary>
    /// 
    /// </summary>
    public class ValidationServiceWS : ValidationServiceRemoting, IValidationManagerWS
    {

        #region IValidationManagerBase Members

        /// <summary>
        /// Returns true if the user exists.
        /// </summary>
        /// <param name="Username">The username.</param>
        /// <returns></returns>
        //[OperationBehavior(TransactionScopeRequired = true)]
        new public bool DoesUserExist(string Username)
        {
            return base.DoesUserExist(Username);
        }

        /// <summary>
        /// Returns true if the user exists.
        /// </summary>
        /// <param name="Username">The username.</param>
        /// <returns></returns>
        [OperationBehavior(TransactionScopeRequired = true)]
        new public bool DoesUserExistPass(string Username, string Password)
        {
            return base.DoesUserExistPass(Username, Password);
        }

        /// <summary>
        /// Returns true if a user belongs to the requested role.
        /// A user belongs to a role if
        /// <list type="bullet">
        /// 		<item>the user is directly attached to a role</item>
        /// 		<item>the groups the user belongs to are attached to a role</item>
        /// 		<item>the groups' child groups are attached to a role</item>
        /// 		<item>the associated groups the user belongs to are attached to a role</item>
        /// 	</list>
        /// Regarding Groups, a user only belongs to a role if he is eiher a group owner or a group member.
        /// </summary>
        /// <param name="ApplicationName">Name of the application.</param>
        /// <param name="RoleName">Name of the role.</param>
        /// <param name="UserName">Name of the user.</param>
        /// <returns></returns>
        [OperationBehavior(TransactionScopeRequired = true)]
        new public bool IsUserInRole(string ApplicationName, string RoleName, string UserName)
        {
            return base.IsUserInRole(ApplicationName, RoleName, UserName);
        }

        /// <summary>
        /// Returns true if a user belongs to the requested role.
        /// A user belongs to a role if
        /// <list type="bullet">
        /// 		<item>the user is directly attached to a role</item>
        /// 		<item>the groups the user belongs to are attached to a role</item>
        /// 		<item>the groups' child groups are attached to a role</item>
        /// 		<item>the associated groups the user belongs to are attached to a role</item>
        /// 	</list>
        /// Regarding Groups, a user only belongs to a role if he is eiher a group owner or a group member.
        /// </summary>
        /// <param name="ApplicationName">Name of the application.</param>
        /// <param name="RoleName">Name of the role.</param>
        /// <param name="UserName">Name of the user.</param>
        /// <returns></returns>
        [OperationBehavior(TransactionScopeRequired = true)]
        new public bool IsUserInRolePass(string ApplicationName, string RoleName, string UserName, string Password)
        {
            return base.IsUserInRolePass(ApplicationName, RoleName, UserName, Password);
        }

        [OperationBehavior(TransactionScopeRequired = true)]
        new public bool IsGroupInRole(string ApplicationName, string RoleName, string GroupName)
        {
            return base.IsGroupInRole(ApplicationName, RoleName, GroupName);
        }

        #endregion

    }
}
